<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript">
			function add(){
				let bt1=document.querySelector("button")
				bt1.addEventListener("click",fun)
			}
			function fun(){
				alert(1)
			}
		</script>
	</head>
	<body>
		<button type="button">按钮</button>
		<button type="button" onclick="add()">添加事件</button>
		<button type="button">移除事件</button>
		<script type="text/javascript">
			let bt3=document.querySelectorAll("button")[2]
			bt3.onclick=function(){
				let bt1=document.querySelector("button")
				bt1.removeEventListener("click",fun)
			}
		</script>
	</body>
</html>
